<template>
  <div class="pagination-container">
    <el-pagination
      background
      layout="total, sizes, prev, pager, next, jumper"
      :total="total"
      :page-size="pageSize"
      :page-sizes="pageSizes"
      :current-page="currentPage"
      @current-change="handleCurrentChange"
      @size-change="handleSizeChange"
    />
  </div>
</template>

<script>
export default {
  name: 'Pagination',
  props: {
    total: {
      type: Number,
      required: true
    },
    pageSize: {
      type: Number,
      default: 10
    },
    currentPage: {
      type: Number,
      default: 1
    },
    pageSizes: {
      type: Array,
      default: () => [10, 20, 30, 50]
    }
  },
  methods: {
    handleCurrentChange(val) {
      this.$emit('current-change', val);
    },
    handleSizeChange(val) {
      this.$emit('size-change', val);
    }
  }
}
</script>

<style lang="scss" scoped>
.pagination-container {
  margin: 30px 0;
  display: flex;
  justify-content: center;
  
  @media (max-width: 768px) {
    :deep(.el-pagination) {
      .el-pagination__sizes {
        display: none;
      }
    }
  }
}
</style> 